<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2"><meta name="theme-color" content="#FFF"><meta name="baidu-site-verification" content="code-DvHFUp3jdk"><meta name="baidu-site-verification" content="code-eHnRZZHAeP"><meta name="baidu-site-verification" content="code-EmlZBboqEW"><meta name="baidu-site-verification" content="code-Hf9ZXEHZ41"><meta name="360-site-verification" content="941073b91e9afaf02748ba000ba47e80"><meta name="360-site-verification" content="010bd45f0d523ce46f298dd597ef0289"><meta name="sogou_site_verification" content="hlLPNfmIjv"><meta name="sogou_site_verification" content="y3La2dTB20"><meta name="msvalidate.01" content="03829B28CC46A7AA4B5503897F475BA1"><script>!function(){var s="https://s.ssl.qhres2.com/ssl/ab77b6ea7f3fbf79.js";document.write('<script src="'+s+'" id="sozz"><\/script>')}()</script><script>!function(t,e,c,n,r,a,s){t[c]=t[c]||function(){(t[c].q=t[c].q||[]).push(arguments)},a=e.createElement(n),a.async=1,a.src="https://www.clarity.ms/tag/"+r+"?ref=bwt",s=e.getElementsByTagName(n)[0],s.parentNode.insertBefore(a,s)}(window,document,"clarity","script","8xwpfccwj2")</script><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?1d318b0509ca0909017253ed6f659ae4";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?aea6c1471d6299bdd1c87a0836f18675";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?498ca413655655a62058d6b5d7c62786";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?e19e8161e13f718806b79f49240583b4";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png"><link rel="icon" type="image/ico" sizes="32x32" href="/images/favicon.ico"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="google-site-verification" content="UA-139249935-1"><meta name="baidu-site-verification" content="cOtBu9CtTEIuwJeN"><link rel="alternate" type="application/rss+xml" title="了尘兰若的小坑" href="https://liaochenlanruo.gitee.io/rss.xml"><link rel="alternate" type="application/atom+xml" title="了尘兰若的小坑" href="https://liaochenlanruo.gitee.io/atom.xml"><link rel="alternate" type="application/json" title="了尘兰若的小坑" href="https://liaochenlanruo.gitee.io/feed.json"><link rel="stylesheet" href="//fonts.googleapis.com/css?family=Mulish:300,300italic,400,400italic,700,700italic%7CFredericka%20the%20Great:300,300italic,400,400italic,700,700italic%7CNoto%20Serif%20JP:300,300italic,400,400italic,700,700italic%7CNoto%20Serif%20SC:300,300italic,400,400italic,700,700italic%7CInconsolata:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext"><link rel="stylesheet" href="/css/app.css?v=0.2.5"><meta name="keywords" content="Functional genomics,CAZy,SY179"><link rel="canonical" href="https://liaochenlanruo.gitee.io/post/9052.html"><title>CAZy碳水化合物活性酶预测 - 生物信息 | ResearchGo = 了尘兰若的小坑 = liaochenlanruo</title><meta name="generator" content="Hexo 5.4.0"></head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">CAZy碳水化合物活性酶预测</h1><div class="meta"><span class="item" title="Created: 2021-09-30 09:18:19"><span class="icon"><i class="ic i-calendar"></i> </span><span class="text">Posted on</span> <time itemprop="dateCreated datePublished" datetime="2021-09-30T09:18:19+08:00">2021-09-30</time> </span><span class="item" title="Symbols count in article"><span class="icon"><i class="ic i-pen"></i> </span><span class="text">Symbols count in article</span> <span>5k</span> <span class="text">words</span> </span><span class="item" title="Reading time"><span class="icon"><i class="ic i-clock"></i> </span><span class="text">Reading time</span> <span>5 mins.</span></span></div></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="Toggle navigation bar"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">ResearchGo</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><img src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/img/custom/bgs/thumb_53.webp"></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="article wrap"><div class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList"><i class="ic i-home"></i> <span><a href="/">Home</a></span><i class="ic i-angle-right"></i> <span class="current" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a href="/categories/Bioinformatics/" itemprop="item" rel="index" title="In 生物信息"><span itemprop="name">生物信息</span></a><meta itemprop="position" content="1"></span></div><article itemscope itemtype="http://schema.org/Article" class="post block" lang="en"><link itemprop="mainEntityOfPage" href="https://liaochenlanruo.gitee.io/post/9052.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="image" content="/images/head.jpg"><meta itemprop="name" content="Hualin Liu"><meta itemprop="description" content="liaochenlanruo, 分享微生物生物信息学分析方法，欢迎加入QQ群交流945751012，不接受群内广告！"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="了尘兰若的小坑"></span><div class="body md" itemprop="articleBody"><div class="gallery" itemscope itemtype="http://schema.org/ImageGallery"><img data-src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/img/custom/bgs/thumb_53.webp" itemprop="contentUrl"></div><h1 id="cazy数据库简介"><a class="anchor" href="#cazy数据库简介">#</a> CAZy 数据库简介</h1><p><span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9Ib21lLmh0bWw=">CAZy</span> 全称为 Carbohydrate-Active enZYmes Database，碳水化合物酶相关的专业数据库，内容包括能催化碳水化合物降解、修饰、以及生物合成的相关酶系家族。其包含五个主要分类：糖苷水解酶（Glycoside Hydrolases, GHs）、糖基转移酶（GlycosylTransferases, GTs）、多糖裂解酶（Polysaccharide Lyases, PLs）、糖酯酶（Carbohydrate Esterases, CEs）和氧化还原酶（Auxiliary Activities, AAs）。此外，还包含与碳水化合物结合结构域（Carbohydrate-Binding Modules， CBMs）。五大分类和一个结构域下，都分别建立了多个 Family。</p><ul><li><p><span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9HbHljb3NpZGUtSHlkcm9sYXNlcy5odG1s">GHs</span>：糖苷键的水解和 / 或重排</p></li><li><p><span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9HbHljb3N5bFRyYW5zZmVyYXNlcy5odG1s">GTs</span>：糖苷键的形成</p></li><li><p><span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9Qb2x5c2FjY2hhcmlkZS1MeWFzZXMuaHRtbA==">PLs</span>：糖苷键的非水解裂解</p></li><li><p><span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9DYXJib2h5ZHJhdGUtRXN0ZXJhc2VzLmh0bWw=">CEs</span>：水解碳水化合物的酯类</p></li><li><p><span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9BdXhpbGlhcnktQWN0aXZpdGllcy5odG1s">AAs</span>：与 CAZymes 协同作用的氧化还原酶</p></li><li><p><span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9DYXJib2h5ZHJhdGUtQmluZGluZy1Nb2R1bGVzLmh0bWw=">CBMs</span>：与碳水化合物结合</p></li></ul><h1 id="cazy数据库的准备"><a class="anchor" href="#cazy数据库的准备">#</a> CAZy 数据库的准备</h1><p>在进行预测之前需要准备数据库，CAZy 貌似没有提供 FASTA 格式的序列数据库，而仅提供了序列的 Assenssion number，需要我们自己从 NCBI 数据库中下载序列。下载方法参照我之前的文章《<span class="exturl" data-url="aHR0cHM6Ly9saWFvY2hlbmxhbnJ1by5naXRodWIuaW8vcG9zdC9lN2U5Lmh0bWw=">根据 assession number 批量从 NCB 下载数据</span>》，在文章中提供了下载 CAZy 序列的方法和脚本，此处不再赘述。</p><p>在上一篇文章结尾获得的 “All.sequences.fas” 文件包含了所有的 CAZy 数据库序列，在正式预测之前需要完成数据库的格式化。后面我们将通过 Diamond 软件从基因组中预测 CAZy 蛋白，因此采用 Diamond 格式化数据库。</p><ul><li><p>序列预处理</p><p>不知道什么原因，下载的序列存在两个问题，其一，下一条序列的 ID 连接着上一条序列的末尾，没有断行；其二，序列中存在着一段网页代码。因此，需要分两步进行修正。</p><ul><li><p>解决断行问题</p><p>撰写脚本 “add_linebreak.pl”，内容如下：</p><figure class="highlight perl"><figcaption data-lang="perl"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment">#!/usr/bin/perl</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token keyword">use</span> strict<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token keyword">use</span> warnings<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment"># Author: Liu hualin</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment"># Date: Sep 30, 2021</span></pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre><span class="token keyword">local</span> <span class="token variable">$/</span><span class="token operator">=</span><span class="token string">">"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="8"></td><td><pre>open IN<span class="token punctuation">,</span> <span class="token string">"All.sequences.fas"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="9"></td><td><pre>open OUT<span class="token punctuation">,</span> <span class="token string">">CAZy.fas"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="10"></td><td><pre><span class="token filehandle symbol">&lt;IN></span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="11"></td><td><pre><span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token filehandle symbol">&lt;IN></span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="12"></td><td><pre>	chomp<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="13"></td><td><pre>	<span class="token keyword">print</span> OUT <span class="token string">">$_\n"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="14"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="15"></td><td><pre>close IN<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="16"></td><td><pre>close OUT<span class="token punctuation">;</span></pre></td></tr></table></figure><p>将脚本与 &quot;All.sequences.fas&quot; 放在同一目录下，在终端或者命令行中运行如下命令，得到 “CAZy.fas”。</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>perl add_linebreak.pl</pre></td></tr></table></figure></li><li><p>删除无关内容</p><p>用 EmEditor 软件打开 CAZy.fas，Ctrl+F 调出查找功能，搜索 “www.” 可以看到如下内容，手动将其删除，并保存文件。</p><p><img data-src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/images/post/9052_1.jpg" alt="数据库中需要手动删除的网页信息"></p></li></ul></li><li><p>构建 Diamond 数据库</p></li></ul><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>diamond makedb --in CAZy.fas -d CAZy</pre></td></tr></table></figure><h1 id="开始序列比对"><a class="anchor" href="#开始序列比对">#</a> 开始序列比对</h1><p>当然，我们选择用 Perl 进行批量比对</p><figure class="highlight perl"><figcaption data-lang="perl"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment">#!/usr/bin/perl</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token keyword">use</span> strict<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token keyword">use</span> warnings<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment"># Author: Liu hualin</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment"># Date: Sep 30, 2021</span></pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre><span class="token keyword">my</span> <span class="token variable">@faa</span> <span class="token operator">=</span> glob<span class="token punctuation">(</span><span class="token string">"*.faa"</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment"># 读取所有后缀为 “.faa” 的文件，可以自己更改</span></pre></td></tr><tr><td data-num="8"></td><td><pre><span class="token keyword">foreach</span>  <span class="token punctuation">(</span><span class="token variable">@faa</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="9"></td><td><pre>	<span class="token variable">$_</span><span class="token operator">=~</span><span class="token regex">/(.+).faa/</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="10"></td><td><pre>	<span class="token keyword">my</span> <span class="token variable">$out</span> <span class="token operator">=</span> <span class="token variable">$1</span> <span class="token operator">.</span> <span class="token string">".CAZy.diamond"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="11"></td><td><pre>	<span class="token comment"># -p 表示线程数，在笔记本上用 6 个即可</span></pre></td></tr><tr><td data-num="12"></td><td><pre>	system<span class="token punctuation">(</span><span class="token string">"diamond blastp -d CAZy -q $_ -e 1e-5 -f 6 -o $out -k 1 --sensitive -p 30 --query-cover 50"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="13"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr></table></figure><p>将上述代码复制到文件中，命名为 “run_diamond_CAZy.pl”，将其和序列文件放在同一目录下，并在终端中输入如下命令，完成分析，得到 “*.CAZy.diamond”：</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>perl run_diamond_CAZy.pl</pre></td></tr></table></figure><h1 id="比对结果过滤"><a class="anchor" href="#比对结果过滤">#</a> 比对结果过滤</h1><p>在比对过程中我们控制了 evalue 和 query coverage，但是没有控制 identity。但是很多时候，需要设定一个 identity 的阈值，低于阈值的比对将会被删除，该步骤可以将比对结果拷贝到 Excel 中根据 identity 排序，手动删除阈值以下的行，然而我选择用 Perl 批处理。</p><figure class="highlight perl"><figcaption data-lang="perl"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment">#!/usr/bin/perl</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token keyword">use</span> strict<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token keyword">use</span> warnings<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment"># Author: Liu hualin</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment"># Date: Sep 30, 2021</span></pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre><span class="token keyword">my</span> <span class="token variable">@cazy</span> <span class="token operator">=</span> glob<span class="token punctuation">(</span><span class="token string">"*.CAZy.diamond"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="8"></td><td><pre><span class="token keyword">foreach</span>  <span class="token punctuation">(</span><span class="token variable">@cazy</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="9"></td><td><pre>	<span class="token variable">$_</span><span class="token operator">=~</span><span class="token regex">/(.+).CAZy.diamond/</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="10"></td><td><pre>	<span class="token keyword">my</span> <span class="token variable">$out</span> <span class="token operator">=</span> <span class="token variable">$1</span> <span class="token operator">.</span> <span class="token string">".CAZy.diamond.filtered"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="11"></td><td><pre>	open IN<span class="token punctuation">,</span> <span class="token string">"$_"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="12"></td><td><pre>	open OUT<span class="token punctuation">,</span> <span class="token string">">$out"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="13"></td><td><pre>	<span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token filehandle symbol">&lt;IN></span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="14"></td><td><pre>		chomp<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="15"></td><td><pre>		<span class="token variable">$_</span><span class="token operator">=~</span><span class="token regex">s/[\r\n]+//g</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="16"></td><td><pre>		<span class="token keyword">my</span> <span class="token variable">@lines</span> <span class="token operator">=</span> split <span class="token regex">/\t/</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="17"></td><td><pre>		<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token variable">$lines</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span> <span class="token operator">>=</span> <span class="token number">40</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="18"></td><td><pre>			<span class="token keyword">print</span> OUT <span class="token variable">$_</span> <span class="token operator">.</span> <span class="token string">"\n"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="19"></td><td><pre>		<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="20"></td><td><pre>	<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="21"></td><td><pre>	close IN<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="22"></td><td><pre>	close OUT<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="23"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr></table></figure><p>将上述代码复制到文件中，命名为 “filter_cazy_diamond.pl”，将其和上一步产生的文件放在同一目录下，并在终端中输入如下命令，完成过滤，保留 identity &gt;= 40% 的行，得到 “*.CAZy.diamond.filtered”。</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>perl filter_cazy_diamond.pl</pre></td></tr></table></figure><h1 id="你以为完了还得mapping"><a class="anchor" href="#你以为完了还得mapping">#</a> 你以为完了？还得 mapping！</h1><p>得到的结果如下图所示，第二列的 Hits 是 NCBI 的 Assession number，我们根本只知道这是什么 CAZy 家族，因此需要 mapping！</p><p><img data-src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/images/post/9052_2.jpg" alt="Diamond比对结果"></p><p>回头找到我们下载的<span class="exturl" data-url="aHR0cDovL3d3dy5jYXp5Lm9yZy9JTUcvY2F6eV9kYXRhL2NhenlfZGF0YS56aXA="> cazy_data.txt</span>，里面保存的是 CAZy 家族与 Assession number 的对应关系。比较闲的兄弟可以用查找 - 复制 - 粘贴的方法将 “*.CAZy.diamond.filtered” 中的 Assession number 替换为 CAZy 家族。我为比较忙的兄弟准备了下面的代码，批处理。不过我输出的是一个矩阵。</p><figure class="highlight perl"><figcaption data-lang="perl"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment">#!/usr/bin/perl</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token keyword">use</span> strict<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token keyword">use</span> warnings<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment"># Author: Liu hualin</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment"># Date: Sep 30, 2021</span></pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre><span class="token keyword">my</span> <span class="token variable">%cazy</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre>open IN<span class="token punctuation">,</span> <span class="token string">"cazy_data.txt"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="10"></td><td><pre><span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token filehandle symbol">&lt;IN></span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="11"></td><td><pre>	chomp<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="12"></td><td><pre>	<span class="token keyword">my</span> <span class="token variable">@lines</span> <span class="token operator">=</span> split <span class="token regex">/\t/</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="13"></td><td><pre>	<span class="token variable">$cazy</span><span class="token punctuation">&#123;</span><span class="token variable">$lines</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span> <span class="token operator">=</span> <span class="token variable">$lines</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="14"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="15"></td><td><pre>close IN<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="16"></td><td><pre></pre></td></tr><tr><td data-num="17"></td><td><pre><span class="token keyword">my</span> <span class="token variable">%hash</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="18"></td><td><pre><span class="token keyword">my</span> <span class="token variable">%samples</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="19"></td><td><pre><span class="token keyword">my</span> <span class="token variable">%ids</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="20"></td><td><pre><span class="token keyword">my</span> <span class="token variable">@filtered</span> <span class="token operator">=</span> glob<span class="token punctuation">(</span><span class="token string">"*.CAZy.diamond.filtered"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="21"></td><td><pre><span class="token keyword">foreach</span>  <span class="token punctuation">(</span><span class="token variable">@filtered</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="22"></td><td><pre>	<span class="token variable">$_</span><span class="token operator">=~</span><span class="token regex">/(.+).CAZy.diamond.filtered/</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="23"></td><td><pre>	<span class="token keyword">my</span> <span class="token variable">$sample</span> <span class="token operator">=</span> <span class="token variable">$1</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="24"></td><td><pre>	<span class="token variable">$samples</span><span class="token punctuation">&#123;</span><span class="token variable">$1</span><span class="token punctuation">&#125;</span><span class="token operator">++</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="25"></td><td><pre>	open IN<span class="token punctuation">,</span> <span class="token string">"$_"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="26"></td><td><pre>	<span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token filehandle symbol">&lt;IN></span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="27"></td><td><pre>		chomp<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="28"></td><td><pre>		<span class="token keyword">my</span> <span class="token variable">@line</span> <span class="token operator">=</span> split <span class="token regex">/\t/</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="29"></td><td><pre>		<span class="token keyword">if</span> <span class="token punctuation">(</span>exists <span class="token variable">$cazy</span><span class="token punctuation">&#123;</span><span class="token variable">$line</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="30"></td><td><pre>			<span class="token variable">$ids</span><span class="token punctuation">&#123;</span><span class="token variable">$cazy</span><span class="token punctuation">&#123;</span><span class="token variable">$line</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">&#125;</span><span class="token operator">++</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="31"></td><td><pre>			<span class="token variable">$hash</span><span class="token punctuation">&#123;</span><span class="token variable">$sample</span><span class="token punctuation">&#125;</span><span class="token punctuation">&#123;</span><span class="token variable">$cazy</span><span class="token punctuation">&#123;</span><span class="token variable">$line</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">&#125;</span><span class="token operator">++</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="32"></td><td><pre>		<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="33"></td><td><pre>	<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="34"></td><td><pre>	close IN<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="35"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="36"></td><td><pre></pre></td></tr><tr><td data-num="37"></td><td><pre>open OUT<span class="token punctuation">,</span> <span class="token string">">CAZy.Matrix.txt"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="38"></td><td><pre></pre></td></tr><tr><td data-num="39"></td><td><pre><span class="token keyword">my</span> <span class="token variable">@samples</span> <span class="token operator">=</span> sort keys <span class="token variable">%samples</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="40"></td><td><pre><span class="token keyword">my</span> <span class="token variable">@ids</span> <span class="token operator">=</span> sort keys <span class="token variable">%ids</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="41"></td><td><pre></pre></td></tr><tr><td data-num="42"></td><td><pre><span class="token keyword">print</span> OUT <span class="token string">"\t"</span> <span class="token operator">.</span> join<span class="token punctuation">(</span><span class="token string">"\t"</span><span class="token punctuation">,</span> <span class="token variable">@samples</span><span class="token punctuation">)</span> <span class="token operator">.</span> <span class="token string">"\n"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="43"></td><td><pre><span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">my</span> <span class="token variable">$i</span><span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> <span class="token variable">$i</span><span class="token operator">&lt;</span><span class="token variable">@ids</span> <span class="token punctuation">;</span><span class="token variable">$i</span><span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="44"></td><td><pre>	<span class="token keyword">print</span> OUT <span class="token variable">$ids</span><span class="token punctuation">[</span><span class="token variable">$i</span><span class="token punctuation">]</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="45"></td><td><pre>	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">my</span> <span class="token variable">$j</span><span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> <span class="token variable">$j</span><span class="token operator">&lt;</span><span class="token variable">@samples</span> <span class="token punctuation">;</span><span class="token variable">$j</span><span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="46"></td><td><pre>		<span class="token keyword">if</span> <span class="token punctuation">(</span>exists <span class="token variable">$hash</span><span class="token punctuation">&#123;</span><span class="token variable">$samples</span><span class="token punctuation">[</span><span class="token variable">$j</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">&#123;</span><span class="token variable">$ids</span><span class="token punctuation">[</span><span class="token variable">$i</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="47"></td><td><pre>			<span class="token keyword">print</span> OUT <span class="token string">"\t$hash&#123;$samples[$j]&#125;&#123;$ids[$i]&#125;"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="48"></td><td><pre>		<span class="token punctuation">&#125;</span><span class="token keyword">else</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="49"></td><td><pre>			<span class="token keyword">print</span> OUT <span class="token string">"\t0"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="50"></td><td><pre>		<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="51"></td><td><pre>	<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="52"></td><td><pre>	<span class="token keyword">print</span> OUT <span class="token string">"\n"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="53"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="54"></td><td><pre>close OUT<span class="token punctuation">;</span></pre></td></tr></table></figure><p>将上述代码复制到文件中，命名为 “<span class="exturl" data-url="aHR0cDovL2Fzc2Vzc2lvbjJjYXp5LnBs">assession2cazy.pl</span>“，将其和”cazy_data.txt“，及上一步产生的文件 “*.CAZy.diamond.filtered” 放在同一目录下，并在终端中输入如下命令：</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>perl assession2cazy.pl</pre></td></tr></table></figure><p>得到一个矩阵 “CAZy.Matrix.txt”，内容如下，行为 CAZy 家族，列为基因组 / 样本名。拿到本文件后，可以做热图看 CAZy 家族在各样本中的分布情况，然而这个热图将会比鞋帮子脸还要长，可读性不高，因此我选择将这些 family 合并为大类，生成一个新的矩阵。</p><p><img data-src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/images/post/9052_3.jpg" alt="Mapping后的矩阵"></p><p>二话不说，上代码。</p><figure class="highlight perl"><figcaption data-lang="perl"></figcaption><table><tr><td data-num="1"></td><td><pre><span class="token comment">#!/usr/bin/perl</span></pre></td></tr><tr><td data-num="2"></td><td><pre><span class="token keyword">use</span> strict<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="3"></td><td><pre><span class="token keyword">use</span> warnings<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="4"></td><td><pre><span class="token comment"># Author: Liu hualin</span></pre></td></tr><tr><td data-num="5"></td><td><pre><span class="token comment"># Date: Sep 30, 2021</span></pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre><span class="token keyword">my</span> <span class="token variable">%category</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="8"></td><td><pre><span class="token keyword">my</span> <span class="token variable">%hash</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="9"></td><td><pre><span class="token keyword">my</span> <span class="token variable">@samples</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="10"></td><td><pre><span class="token keyword">my</span> <span class="token variable">$count</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="11"></td><td><pre>open IN<span class="token punctuation">,</span> <span class="token string">"CAZy.Matrix.txt"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="12"></td><td><pre><span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token filehandle symbol">&lt;IN></span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="13"></td><td><pre>	<span class="token variable">$count</span><span class="token operator">++</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="14"></td><td><pre>	chomp<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="15"></td><td><pre>	<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token variable">$count</span> <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="16"></td><td><pre>		<span class="token variable">@samples</span> <span class="token operator">=</span> split<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="17"></td><td><pre>	<span class="token punctuation">&#125;</span><span class="token keyword">else</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="18"></td><td><pre>		<span class="token keyword">my</span> <span class="token variable">@lines</span> <span class="token operator">=</span> split<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="19"></td><td><pre>		<span class="token variable">$lines</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">=~</span><span class="token regex">/(.+?)\d+/</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="20"></td><td><pre>		<span class="token keyword">my</span> <span class="token variable">$cate</span> <span class="token operator">=</span> <span class="token variable">$1</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="21"></td><td><pre>		<span class="token variable">$category</span><span class="token punctuation">&#123;</span><span class="token variable">$cate</span><span class="token punctuation">&#125;</span><span class="token operator">++</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="22"></td><td><pre>		<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">my</span> <span class="token variable">$i</span><span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> <span class="token variable">$i</span><span class="token operator">&lt;</span><span class="token variable">@samples</span><span class="token punctuation">;</span> <span class="token variable">$i</span><span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="23"></td><td><pre>			<span class="token keyword">my</span> <span class="token variable">$j</span> <span class="token operator">=</span> <span class="token variable">$i</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="24"></td><td><pre>			<span class="token variable">$hash</span><span class="token punctuation">&#123;</span><span class="token variable">$samples</span><span class="token punctuation">[</span><span class="token variable">$i</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">&#123;</span><span class="token variable">$cate</span><span class="token punctuation">&#125;</span> <span class="token operator">+=</span> <span class="token variable">$lines</span><span class="token punctuation">[</span><span class="token variable">$j</span><span class="token punctuation">]</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="25"></td><td><pre>		<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="26"></td><td><pre>	<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="27"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="28"></td><td><pre>close IN<span class="token punctuation">;</span></pre></td></tr><tr><td data-num="29"></td><td><pre></pre></td></tr><tr><td data-num="30"></td><td><pre></pre></td></tr><tr><td data-num="31"></td><td><pre>open OUT<span class="token punctuation">,</span> <span class="token string">">CAZy.Category.Matrix.txt"</span> <span class="token operator">||</span> <span class="token keyword">die</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="32"></td><td><pre></pre></td></tr><tr><td data-num="33"></td><td><pre><span class="token keyword">my</span> <span class="token variable">@category</span> <span class="token operator">=</span> sort keys <span class="token variable">%category</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="34"></td><td><pre></pre></td></tr><tr><td data-num="35"></td><td><pre><span class="token keyword">print</span> OUT <span class="token string">"\t"</span> <span class="token operator">.</span> join<span class="token punctuation">(</span><span class="token string">"\t"</span><span class="token punctuation">,</span> <span class="token variable">@samples</span><span class="token punctuation">)</span> <span class="token operator">.</span> <span class="token string">"\n"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="36"></td><td><pre><span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">my</span> <span class="token variable">$i</span><span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> <span class="token variable">$i</span><span class="token operator">&lt;</span><span class="token variable">@category</span> <span class="token punctuation">;</span><span class="token variable">$i</span><span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="37"></td><td><pre>	<span class="token keyword">print</span> OUT <span class="token variable">$category</span><span class="token punctuation">[</span><span class="token variable">$i</span><span class="token punctuation">]</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="38"></td><td><pre>	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">my</span> <span class="token variable">$j</span><span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> <span class="token variable">$j</span><span class="token operator">&lt;</span><span class="token variable">@samples</span> <span class="token punctuation">;</span><span class="token variable">$j</span><span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="39"></td><td><pre>		<span class="token keyword">if</span> <span class="token punctuation">(</span>exists <span class="token variable">$hash</span><span class="token punctuation">&#123;</span><span class="token variable">$samples</span><span class="token punctuation">[</span><span class="token variable">$j</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">&#123;</span><span class="token variable">$category</span><span class="token punctuation">[</span><span class="token variable">$i</span><span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="40"></td><td><pre>			<span class="token keyword">print</span> OUT <span class="token string">"\t$hash&#123;$samples[$j]&#125;&#123;$category[$i]&#125;"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="41"></td><td><pre>		<span class="token punctuation">&#125;</span><span class="token keyword">else</span> <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="42"></td><td><pre>			<span class="token keyword">print</span> OUT <span class="token string">"\t0"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="43"></td><td><pre>		<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="44"></td><td><pre>	<span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="45"></td><td><pre>	<span class="token keyword">print</span> OUT <span class="token string">"\n"</span><span class="token punctuation">;</span></pre></td></tr><tr><td data-num="46"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="47"></td><td><pre>close OUT<span class="token punctuation">;</span></pre></td></tr></table></figure><p>将上述代码复制到文件中，命名为 “<span class="exturl" data-url="aHR0cDovL2NhenlmYW1pbHkyY2F0ZWdvcmllcy5wbA==">cazyfamily2categories.pl</span>”，将其和上一步产生的文件 “CAZy.Matrix.txt” 放在同一目录下，并在终端中输入如下命令，得到文件 “CAZy.Category.Matrix.txt”。</p><figure class="highlight bash"><figcaption data-lang="bash"></figcaption><table><tr><td data-num="1"></td><td><pre>perl cazyfamily2categories.pl</pre></td></tr></table></figure><p><img data-src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/images/post/9052_4.jpg" alt="CAZy.Category.Matrix.txt内容概览"></p><p>接下来是要做柱状图还是 heatmap，就随便了。</p><h1 id="脚本获取"><a class="anchor" href="#脚本获取">#</a> 脚本获取</h1><p>关注公众号 “生信之巅”，聊天窗口回复 “9052” 获取下载链接。</p><table align="center"><tr><td align="center"><img data-src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/img/social/生信之巅公众号.jpg" alt="生信之巅微信公众号" style="width:100px;height:100px;vertical-align:-20px;border-radius:0;margin-right:0;margin-bottom:5px;align:center"></td><td align="center"><img data-src="https://fastly.jsdelivr.net/gh/liaochenlanruo/cdn@master/img/social/小程序码.png" alt="生信之巅小程序码" style="width:100px;height:100px;vertical-align:-20px;border-radius:0;margin-left:0;margin-bottom:5px;align:center"></td></tr></table><p><font color="#FF0000"><ruby><b>敬告</b>：使用文中脚本请引用本文网址，请尊重本人的劳动成果，谢谢！<rt><b>Notice</b>: When you use the scripts in this article, please cite the link of this webpage. Thank you!</rt></ruby></font></p><div class="tags"><a href="/tags/Functional-genomics/" rel="tag"><i class="ic i-tag"></i> Functional genomics</a> <a href="/tags/CAZy/" rel="tag"><i class="ic i-tag"></i> CAZy</a> <a href="/tags/SY179/" rel="tag"><i class="ic i-tag"></i> SY179</a></div></div><footer><div class="meta"><span class="item"><span class="icon"><i class="ic i-calendar-check"></i> </span><span class="text">Edited on</span> <time title="Modified: 2022-05-31 09:41:33" itemprop="dateModified" datetime="2022-05-31T09:41:33+08:00">2022-05-31</time> </span><span id="post/9052.html" class="item leancloud_visitors" data-flag-title="CAZy碳水化合物活性酶预测" title="Views"><span class="icon"><i class="ic i-eye"></i> </span><span class="text">Views</span> <span class="leancloud-visitors-count"></span> <span class="text">times</span></span></div><div class="reward"><button><i class="ic i-heartbeat"></i> Donate</button><p>Give me a cup of [coffee]~(￣▽￣)~*</p><div id="qr"><div><img data-src="/images/reward-wepays.jpg" alt="Hualin Liu WeChat Pay"><p>WeChat Pay</p></div><div><img data-src="/images/AliPays.jpg" alt="Hualin Liu Alipay"><p>Alipay</p></div></div></div><div id="copyright"><ul><li class="author"><strong>Post author: </strong>liaochenlanruo <i class="ic i-at"><em>@</em></i>了尘兰若的小坑</li><li class="link"><strong>Post link: </strong><a href="https://liaochenlanruo.gitee.io/post/9052.html" title="CAZy碳水化合物活性酶预测">https://liaochenlanruo.gitee.io/post/9052.html</a></li><li class="license"><strong>Copyright Notice: </strong>All articles in this blog are licensed under <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzQuMC9kZWVkLnpo"><i class="ic i-creative-commons"><em>(CC)</em></i>BY-NC-SA</span> unless stating additionally.</li></ul></div></footer></article></div><div class="post-nav"><div class="item left"><a href="/post/412a.html" itemprop="url" rel="prev" data-background-image="https:&#x2F;&#x2F;fastly.jsdelivr.net&#x2F;gh&#x2F;liaochenlanruo&#x2F;cdn@master&#x2F;img&#x2F;custom&#x2F;bgs&#x2F;thumb_71.webp" title="构建样本vs基因矩阵"><span class="type">Previous Post</span> <span class="category"><i class="ic i-flag"></i> 生物信息</span><h3>构建样本vs基因矩阵</h3></a></div><div class="item right"><a href="/post/112a.html" itemprop="url" rel="next" data-background-image="https:&#x2F;&#x2F;fastly.jsdelivr.net&#x2F;gh&#x2F;liaochenlanruo&#x2F;cdn@master&#x2F;img&#x2F;custom&#x2F;bgs&#x2F;thumb_17.webp" title="Hexo渲染异常"><span class="type">Next Post</span> <span class="category"><i class="ic i-flag"></i> 网站建设</span><h3>Hexo渲染异常</h3></a></div></div><div class="wrap" id="comments"></div></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="Contents"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#cazy%E6%95%B0%E6%8D%AE%E5%BA%93%E7%AE%80%E4%BB%8B"><span class="toc-number">1.</span> <span class="toc-text">CAZy 数据库简介</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#cazy%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E5%87%86%E5%A4%87"><span class="toc-number">2.</span> <span class="toc-text">CAZy 数据库的准备</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%BC%80%E5%A7%8B%E5%BA%8F%E5%88%97%E6%AF%94%E5%AF%B9"><span class="toc-number">3.</span> <span class="toc-text">开始序列比对</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%AF%94%E5%AF%B9%E7%BB%93%E6%9E%9C%E8%BF%87%E6%BB%A4"><span class="toc-number">4.</span> <span class="toc-text">比对结果过滤</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BD%A0%E4%BB%A5%E4%B8%BA%E5%AE%8C%E4%BA%86%E8%BF%98%E5%BE%97mapping"><span class="toc-number">5.</span> <span class="toc-text">你以为完了？还得 mapping！</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E8%84%9A%E6%9C%AC%E8%8E%B7%E5%8F%96"><span class="toc-number">6.</span> <span class="toc-text">脚本获取</span></a></li></ol></div><div class="related panel pjax" data-title="Related"><ul><li><a href="/post/19824.html" rel="bookmark" title="生物信息学1：VMware虚拟机及Bio-linux安装与配置">生物信息学1：VMware虚拟机及Bio-linux安装与配置</a></li><li><a href="/post/9.html" rel="bookmark" title="生物信息学2：VirtualBox虚拟机及Bio-Linux安装">生物信息学2：VirtualBox虚拟机及Bio-Linux安装</a></li><li><a href="/post/10877.html" rel="bookmark" title="生物信息学3：微生物基因组学常用软件安装">生物信息学3：微生物基因组学常用软件安装</a></li><li><a href="/post/30650.html" rel="bookmark" title="根据基因组预测表型 —— traitar的安装与使用">根据基因组预测表型 —— traitar的安装与使用</a></li><li><a href="/post/44606.html" rel="bookmark" title="kSNP3寻找SNPs并构建进化树">kSNP3寻找SNPs并构建进化树</a></li><li><a href="/post/43504.html" rel="bookmark" title="用wget批量下载含有链接的文件/目录">用wget批量下载含有链接的文件/目录</a></li><li><a href="/post/94f2.html" rel="bookmark" title="为PubMed添加功能">为PubMed添加功能</a></li><li><a href="/post/4e1.html" rel="bookmark" title="OrthoFinder2—同源蛋白家族聚类">OrthoFinder2—同源蛋白家族聚类</a></li><li><a href="/post/848f.html" rel="bookmark" title="PGCGAP中文说明">PGCGAP中文说明</a></li><li><a href="/post/d163.html" rel="bookmark" title="Bioconda贡献指南">Bioconda贡献指南</a></li><li><a href="/post/f6c9.html" rel="bookmark" title="Linux和基因组测序技术初识">Linux和基因组测序技术初识</a></li><li><a href="/post/5908.html" rel="bookmark" title="BtToxin_Digger--A high-throughput Bacillus thuringiensis toxin mining pipeline">BtToxin_Digger--A high-throughput Bacillus thuringiensis toxin mining pipeline</a></li><li><a href="/post/ab1b.html" rel="bookmark" title="宏基因组分析流程及代码">宏基因组分析流程及代码</a></li><li><a href="/post/4cf4.html" rel="bookmark" title="Use microeco分析扩增子数据">Use microeco分析扩增子数据</a></li><li><a href="/post/1755.html" rel="bookmark" title="扩增子分析--计算随机过程和决定性过程比例">扩增子分析--计算随机过程和决定性过程比例</a></li><li><a href="/post/e7e9.html" rel="bookmark" title="根据assession number批量从NCB下载数据">根据assession number批量从NCB下载数据</a></li><li><a href="/post/e922.html" rel="bookmark" title="Swissprot数据库的本地化与序列比对并与其他数据库快速mapping">Swissprot数据库的本地化与序列比对并与其他数据库快速mapping</a></li><li><a href="/post/412a.html" rel="bookmark" title="构建样本vs基因矩阵">构建样本vs基因矩阵</a></li><li class="active"><a href="/post/9052.html" rel="bookmark" title="CAZy碳水化合物活性酶预测">CAZy碳水化合物活性酶预测</a></li><li><a href="/post/5324.html" rel="bookmark" title="原核生物基因岛预测">原核生物基因岛预测</a></li><li><a href="/post/d9f9.html" rel="bookmark" title="按照Contig切割GenBank文件">按照Contig切割GenBank文件</a></li><li><a href="/post/3a23.html" rel="bookmark" title="从GenBank文件中提取Features">从GenBank文件中提取Features</a></li><li><a href="/post/fb68.html" rel="bookmark" title="使用EffectiveT3预测微生物中的III型分泌系统效应蛋白">使用EffectiveT3预测微生物中的III型分泌系统效应蛋白</a></li><li><a href="/post/c886.html" rel="bookmark" title="SignalP+TMHMM预测微生物分泌蛋白">SignalP+TMHMM预测微生物分泌蛋白</a></li><li><a href="/post/6a93.html" rel="bookmark" title="在FASTA文件中搜索完全匹配的短序列">在FASTA文件中搜索完全匹配的短序列</a></li><li><a href="/post/ea71.html" rel="bookmark" title="在Linux服务器中安装网页版Rstudio">在Linux服务器中安装网页版Rstudio</a></li><li><a href="/post/a713.html" rel="bookmark" title="R语言安装依赖包错误集锦">R语言安装依赖包错误集锦</a></li><li><a href="/post/d444.html" rel="bookmark" title="NCBI上传基因簇之tbl2asn的使用">NCBI上传基因簇之tbl2asn的使用</a></li><li><a href="/post/18ea.html" rel="bookmark" title="利用NCycDB数据库从宏基因组中预测氮循环基因">利用NCycDB数据库从宏基因组中预测氮循环基因</a></li><li><a href="/post/36cc.html" rel="bookmark" title="R语言绘制分组条形图">R语言绘制分组条形图</a></li><li><a href="/post/1551.html" rel="bookmark" title="宏病毒组分析流程1-VirSorter2">宏病毒组分析流程1-VirSorter2</a></li><li><a href="/post/8fb3.html" rel="bookmark" title="利用GTDB-TK对细菌和古菌基因组进行物种分类">利用GTDB-TK对细菌和古菌基因组进行物种分类</a></li><li><a href="/post/85d7.html" rel="bookmark" title="计算蛋白质等电点并绘制全局pI图">计算蛋白质等电点并绘制全局pI图</a></li><li><a href="/post/92eb.html" rel="bookmark" title="使用DeepARG预测抗生素抗性基因ARGs">使用DeepARG预测抗生素抗性基因ARGs</a></li><li><a href="/post/74ad.html" rel="bookmark" title="Nanopore基因组组装">Nanopore基因组组装</a></li><li><a href="/post/2581.html" rel="bookmark" title="使用eggNOG-mapper注释基因组">使用eggNOG-mapper注释基因组</a></li><li><a href="/post/d862.html" rel="bookmark" title="PGCGAP - the Prokaryotic Genomics and Comparative Genomics Analysis Pipeline v1.0.33">PGCGAP - the Prokaryotic Genomics and Comparative Genomics Analysis Pipeline v1.0.33</a></li><li><a href="/post/e6ae.html" rel="bookmark" title="利用PGCGAP根据ids提取序列信息">利用PGCGAP根据ids提取序列信息</a></li><li><a href="/post/213.html" rel="bookmark" title="多种方法批量下载NCBI基因组">多种方法批量下载NCBI基因组</a></li><li><a href="/post/33b.html" rel="bookmark" title="代谢组相关软件的安装及使用">代谢组相关软件的安装及使用</a></li><li><a href="/post/377e.html" rel="bookmark" title="使用xcms3处理和分析LC-MS数据">使用xcms3处理和分析LC-MS数据</a></li><li><a href="/post/df57.html" rel="bookmark" title="用metid构建代谢组数据库">用metid构建代谢组数据库</a></li><li><a href="/post/0.html" rel="bookmark" title="基于TidyMass的非靶向代谢组学分析">基于TidyMass的非靶向代谢组学分析</a></li><li><a href="/post/29bf.html" rel="bookmark" title="批量下载某研究方向重要文献">批量下载某研究方向重要文献</a></li><li><a href="/post/c617.html" rel="bookmark" title="16S扩增子测序及宏基因组测序">16S扩增子测序及宏基因组测序</a></li><li><a href="/post/1177.html" rel="bookmark" title="用MaAsLin2包做微生物组多变量线性模型关联分析">用MaAsLin2包做微生物组多变量线性模型关联分析</a></li><li><a href="/post/7449.html" rel="bookmark" title="NCBI上传基因簇之table2asn的使用">NCBI上传基因簇之table2asn的使用</a></li></ul></div><div class="overview panel" data-title="Overview"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" itemprop="image" alt="Hualin Liu" data-src="/images/head.jpg"><p class="name" itemprop="name">Hualin Liu</p><div class="description" itemprop="description">分享微生物生物信息学分析方法，欢迎加入QQ群交流945751012，不接受群内广告！</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">130</span> <span class="name">posts</span></a></div><div class="item categories"><a href="/categories/"><span class="count">12</span> <span class="name">categories</span></a></div><div class="item tags"><a href="/tags/"><span class="count">54</span> <span class="name">tags</span></a></div></nav><div class="social"><span class="exturl item github" data-url="aHR0cDovL2dpdGh1Yi5jb20vbGlhb2NoZW5sYW5ydW8=" title="http:&#x2F;&#x2F;github.com&#x2F;liaochenlanruo"><i class="ic i-github"></i></span> <span class="exturl item zhihu" data-url="aHR0cHM6Ly93d3cuemhpaHUuY29tL3Blb3BsZS9zdWFuLWxhLW1pYW4tcGlhbi10YW5nLWNpdW0=" title="https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;suan-la-mian-pian-tang-cium"><i class="ic i-zhihu"></i></span> <span class="exturl item weibo" data-url="aHR0cHM6Ly93ZWliby5jb20vdS8yNzE1MjEwOTIz" title="https:&#x2F;&#x2F;weibo.com&#x2F;u&#x2F;2715210923"><i class="ic i-weibo"></i></span> <span class="exturl item about" data-url="aHR0cHM6Ly93d3cubGlhb2NoZW5sYW5ydW8uZnVuL2Fib3V0" title="https:&#x2F;&#x2F;www.liaochenlanruo.fun&#x2F;about"><i class="ic i-address-card"></i></span> <span class="exturl item email" data-url="bWFpbHRvOmxpYW9jaGVubGFucnVvQHdlYm1haWwuaHphdS5lZHUuY24=" title="mailto:liaochenlanruo@webmail.hzau.edu.cn"><i class="ic i-envelope"></i></span> <span class="exturl item douban" data-url="aHR0cHM6Ly93d3cuZG91YmFuLmNvbS9wZW9wbGUvbGlhb2NoZW5sYW5ydW8vP19pPTczNDYxMjVRalo1QjZWLw==" title="https:&#x2F;&#x2F;www.douban.com&#x2F;people&#x2F;liaochenlanruo&#x2F;?_i&#x3D;7346125QjZ5B6V&#x2F;"><i class="ic i-douban"></i></span> <span class="exturl item google" data-url="aHR0cHM6Ly9zY2hvbGFyLmdvb2dsZS5jby5qcC9jaXRhdGlvbnM/dXNlcj1YYW9STk1RQUFBQUomaGw9amE=" title="https:&#x2F;&#x2F;scholar.google.co.jp&#x2F;citations?user&#x3D;XaoRNMQAAAAJ&amp;hl&#x3D;ja"><i class="ic i-google"></i></span></div><ul class="menu"><li class="item"><a href="/" rel="section"><i class="ic i-home"></i>Home</a></li><li class="item dropdown"><a href="javascript:void(0);"><i class="ic i-user"></i>About</a><ul class="submenu"><li class="item"><a href="/about/" rel="section"><i class="ic i-user"></i>About me</a></li><li class="item"><a href="/comment/" rel="section"><i class="ic i-envelope"></i>Comment</a></li></ul></li><li class="item dropdown"><a href="javascript:void(0);"><i class="ic i-feather"></i>Posts</a><ul class="submenu"><li class="item"><a href="/archives/" rel="section"><i class="ic i-list-alt"></i>Archives</a></li><li class="item"><a href="/categories/" rel="section"><i class="ic i-th"></i>Categories</a></li><li class="item"><a href="/tags/" rel="section"><i class="ic i-tags"></i>Tags</a></li></ul></li><li class="item dropdown"><a href="javascript:void(0);"><i class="ic i-list-ol"></i>List</a><ul class="submenu"><li class="item"><a href="/photos/" rel="section"><i class="ic i-person"></i>Photos</a></li><li class="item"><a href="/skip/gallery/" rel="section"><i class="ic i-cloud"></i>Gallery</a></li><li class="item"><a href="/skip/box/" rel="section"><i class="ic i-magic"></i>Box</a></li><li class="item"><span class="exturl" data-url="aHR0cHM6Ly9saWFvY2hlbmxhbnJ1by5mdW4vcmVmZXJlbmNlLw=="><i class="ic i-th"></i>cheatsheets</span></li></ul></li><li class="item"><a href="/donate/" rel="section"><i class="ic i-coffee"></i>Donate</a></li><li class="item"><a href="/friends/" rel="section"><i class="ic i-heart"></i>Friends</a></li><li class="item"><span class="exturl" data-url="aHR0cHM6Ly9saWFvY2hlbmxhbnJ1by5naXRodWIuaW8="><i class="ic i-external-link-alt"></i>中文版</span></li><li class="item"><span class="exturl" data-url="aHR0cHM6Ly90cmF2ZWxsaW5ncy5saW5r"><i class="ic i-forward"></i>Travelling</span></li></ul></div></div></div><ul id="quick"><li class="prev pjax"><a href="/post/412a.html" rel="prev" title="Previous Post"><i class="ic i-chevron-left"></i></a></li><li class="up"><i class="ic i-arrow-up"></i></li><li class="down"><i class="ic i-arrow-down"></i></li><li class="next pjax"><a href="/post/112a.html" rel="next" title="Next Post"><i class="ic i-chevron-right"></i></a></li><li class="percent"></li></ul></div></div><div class="dimmer"></div></div></main><footer id="footer"><div class="inner"><div class="widgets"></div><div class="status"><div class="copyright">&copy; 2018 – <span itemprop="copyrightYear">2024</span> <span class="with-love"><i class="ic i-sakura rotate"></i> </span><span class="author" itemprop="copyrightHolder">Hualin Liu @ ResearchGo</span></div><div class="count"><span class="post-meta-item-icon"><i class="ic i-chart-area"></i> </span><span title="Symbols count total">788k words</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="ic i-coffee"></i> </span><span title="Reading time total">11:57</span><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="ic i-info-circle"></i> </span><span style="padding-left:1px"><span id="busuanzi_container_site_pv">Total visits: <span id="busuanzi_value_site_pv" style="color:#f99"></span> times</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="ic i-user"></i> </span><span style="padding-left:1px"><span id="busuanzi_container_site_uv">Total visitors: <span id="busuanzi_value_site_uv" style="color:#f99"></span> people</span></span></span></div><div class="powered-by">Powered by <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & Theme.<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2FtZWhpbWUvaGV4by10aGVtZS1zaG9rYQ==">Shoka</span></div></div></div></footer></div><script data-config type="text/javascript">var LOCAL={path:"post/9052.html",favicon:{show:"（●´3｀●）Goooood",hide:"(´Д｀)Booooom"},search:{placeholder:"Search for Posts",empty:"We didn't find any results for the search: ${query}",stats:"${hits} results found in ${time} ms"},valine:!0,fancybox:!0,copyright:'Copied to clipboard successfully! <br> All articles in this blog are licensed under <i class="ic i-creative-commons"></i>BY-NC-SA.',ignores:[function(e){return e.includes("#")},function(e){return new RegExp(LOCAL.path+"$").test(e)}]}</script><script src="https://cdn.polyfill.io/v2/polyfill.js"></script><script src="//cdn.jsdelivr.net/combine/npm/pace-js@1.0.2/pace.min.js,npm/pjax@0.2.8/pjax.min.js,npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js,npm/animejs@3.2.0/lib/anime.min.js,npm/algoliasearch@4/dist/algoliasearch-lite.umd.js,npm/instantsearch.js@4/dist/instantsearch.production.min.js,npm/lozad@1/dist/lozad.min.js,npm/quicklink@2/dist/quicklink.umd.js"></script><script src="/js/app.js?v=0.2.5"></script><script data-pjax>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?d211830a796ceefb38a141fde14e4d5a";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script></body></html>